(function($){"use strict";UNCODE.animatedBgGradient=function(_el){var ev;typeof _el=="undefined"||_el===null?(_el=document,ev=!1):(_el=_el[0],ev="shortcode:update");var simplex=new SimplexNoise,Uncode_BG_Animated_Gradient=function(blockOverlay,canvasWrap){this.block=blockOverlay,this.wrap=canvasWrap,this.config(),this.checker(),this.loopRAF(),this.animLoader()},AnimGradient=Uncode_BG_Animated_Gradient.prototype;AnimGradient.config=function(){this.canvas=document.createElement("canvas"),this.wrap.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.count=0,this.isOrientationChanged=!1,this.res=UNCODE.isMobile?90:110,this.resPercent=100/this.res,this.resAround=this.resPercent/100,this.size=typeof this.block.getAttribute("data-bg-noise-size")!="undefined"&&this.block.getAttribute("data-bg-noise-size")!==null&&this.block.getAttribute("data-bg-noise-size")!==""?this.block.getAttribute("data-bg-noise-size"):1,this.canvas.classList.add("uncode-bg-animated-gradient"),this.canvas.setAttribute("height",this.res),this.canvas.setAttribute("width",this.res),this.canvas.style="height: 100%; position: relative; width:100%;",this.imgdata=this.ctx.getImageData(0,0,this.canvas.width,this.canvas.height),this.cx=this.canvas.width/2,this.cy=this.canvas.height/2,this.data=this.imgdata.data,this.opts={col_1st:typeof this.block.getAttribute("data-bg-noise-1")!="undefined"&&this.block.getAttribute("data-bg-noise-1")!==null&&this.block.getAttribute("data-bg-noise-1")!==""?this.block.getAttribute("data-bg-noise-1"):!1,col_2nd:typeof this.block.getAttribute("data-bg-noise-2")!="undefined"&&this.block.getAttribute("data-bg-noise-2")!==null&&this.block.getAttribute("data-bg-noise-2")!==""?this.block.getAttribute("data-bg-noise-2"):!1,time:typeof this.block.getAttribute("data-bg-noise-speed")!="undefined"&&this.block.getAttribute("data-bg-noise-speed")!==null&&this.block.getAttribute("data-bg-noise-speed")!==""?parseFloat(this.block.getAttribute("data-bg-noise-speed")):250},this.lavaTime=1,this.bg_colors=[];if(this.opts.col_1st===!1&&this.opts.col_2nd===!1)return;if(this.opts.col_1st===this.opts.col_2nd||this.opts.col_2nd==0)this.singleColor=!0;if(this.opts.col_1st){var rgbColor1=this.hexToRGB(this.opts.col_1st);this.bg_colors.push({r:rgbColor1.r,g:rgbColor1.g,b:rgbColor1.b})}if(this.opts.col_2nd){var rgbColor2=this.hexToRGB(this.opts.col_2nd);this.bg_colors.push({r:rgbColor2.r,g:rgbColor2.g,b:rgbColor2.b})}},AnimGradient.checker=function(){var scope=this;this.checkInViewPort(),window.addEventListener("resize",function(){if(UNCODE.isMobile&&!scope.isOrientationChanged)return;scope.ratioCalc()}),window.addEventListener("orientationchange",function(){scope.isOrientationChanged=!0}),this.ratioCalc()},AnimGradient.ratioCalc=function(){var blockW=this.block.clientWidth,blockH=this.block.clientHeight;if(blockH==0||blockW==0)return;var blockRatio=blockH/blockW;blockRatio<1?this.ratioParam={x:1.4,y:blockRatio*1.4}:this.ratioParam={x:blockRatio/3,y:1}},AnimGradient.checkInViewPort=function(){var scope=this;if($(scope.block).closest(".unmenu-inner-ul").length)scope.isInViewport=!0;else if("IntersectionObserver"in window){var observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){entry.isIntersecting?scope.isInViewport=!0:scope.isInViewport=!1})},{root:document});observer.observe(scope.block)}},AnimGradient.hexToRGB=function(hexval){var hexecuted=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hexval);return hexecuted?{r:parseInt(hexecuted[1],16),g:parseInt(hexecuted[2],16),b:parseInt(hexecuted[3],16)}:!1},AnimGradient.factor=function(val_1,val_2,lava){return val_1*(1-lava)+val_2*lava},AnimGradient.factorNoise=function(wave_l,x,y,noise){return this.singleColor?this.bg_colors[0][wave_l]:this.factor(this.bg_colors[0][wave_l],this.bg_colors[1][wave_l],this.lava(x,y,this.count*this.lavaTime)*this.resAround*3.5*noise/2)},AnimGradient.lava=function(x,y,grade){var radians=Math.PI/180*grade,cos=Math.cos(radians),sin=Math.sin(radians),nx=cos*(x-this.cx)+sin*(y-this.cy)+this.cx;return nx},AnimGradient.loopRAF=function(){var scope=this;if(this.isInViewport&&typeof this.ratioParam!="undefined"){for(var x=0;x